<div class="ticket-tt" id="ticket-tt" data-type="1">
    <div class="ticket-tt-t">
        <div class="ticket-l">月票</div>
        <a href="/user/helpDetail?id=10607" class="ticket-r">
            ?
        </a>
    </div>
    <div class="ticket-val">
        <h4 class="ticket-l">
            <i class="icon-ticket-month"></i>月票
        </h4>
        <strong class="ticket-r"><output class="ticket-output" id="month">0</output></strong>
    </div>
</div>
<h4 class="ticket-rt">投月票记录</h4>
<div class="module module-merge" id="recordWrapper">
    <ol class="record-ol record-ol-ticket" id="ticketRecordOl">

    </ol>
</div>
<script type="text/template" class="hide1" id="tpl">
    <li class="record-li-ticket" data-mid="{{mid}}" data-index="{{index}}">
        <div class="record-li-left">
            <span>投月票</span>
            <span>{{startTime}}</span>
        </div>
        <div class="record-li-right">
            <span>{{bName}}</span>
            <span>{{month}}票</span>
        </div>
    </li>
</script>
<script>
    _$(function(){
        _$.post('/getuserHeadimg',function(data){
            if(data['code']==1) {
                var userinfo = data['info']['userinfo'];
                var username = data['info']['username'];
                _$("#month").html(userinfo['month']);
            }
        })
        _$.post('/getMonthList',function(data){
            console.log(data);
            if(data.code==1){
                var monthArr=data.info.monthArr;
                var bookArr=data.info.bookArr;
                if(monthArr.length>0){
                    var html="";
                    for(var val in monthArr){
                        monthArr[val]['startTime']=getTimes(monthArr[val]['startTime']);
                        monthArr[val]['index']=parseInt(val)+1;
                        monthArr[val]['bName']=bookArr[val]['bName'];
                        html += template('tpl', monthArr[val]);
                    }
                    _$("#ticketRecordOl").append(html);
                }else{
                    _$("#ticketRecordOl").html('<div class="null-x"><div class="null">近期暂无投票记录</div></div>');
                }
            }
        })
    })
</script>